package com.demo2do.fms.admin.entity.vam;

import com.demo2do.fms.entity.authority.Organization;
import com.demo2do.fms.entity.authority.User;

/**
 *
 * @author Ark
 *
 */
public class UserStat {
    
    /** 运输公司id */
    private Long organizationId;

    /** 运输公司代码 */
    private String organizationCode;
    
    /** fms用户id */
    private Long userId;
    
    /** 用户登录名 */
    private String userLoginName;
    
    /** 用户姓名 */
    private String username;
    
    /** 部门ID */
    private Long departmentId;
    
    /** 座机号码 */
    private String phone;
    
    /** 手机号码 */
    private String mobile;
    
    /** 电子邮箱 */
    private String email;
    
    /** 是否禁用 */
    private boolean disabled;
    
    /**
     * The default constructor
     */
    public UserStat() {
    }

    /**
     * @param user
     * @param organization
     * @param department
     */
    public UserStat(User user, Organization organization) {
        this.organizationId = organization.getId();
        this.organizationCode = organization.getCode();
        this.userId = user.getId();
        this.userLoginName = user.getLoginName();
        this.username = user.getName();
        this.departmentId = user.getDepartmentId();
        this.phone = user.getPhone();
        this.mobile = user.getMobile();
        this.email = user.getEmail();
        this.disabled = user.getDisabled();
    }

    /**
     * 构建总部、分区数据
     * @param user
     * @return
     */
    public UserStat buildAdminOrBranchData(User user) {
    	
    	// 总部、分区用户固定三个值
    	this.organizationId = 1L;
        this.organizationCode = "*";
        this.departmentId = 1L;
        
        this.userId = user.getId();
        this.userLoginName = user.getLoginName();
        this.username = user.getName();
        this.phone = user.getPhone();
        this.mobile = user.getMobile();
        this.email = user.getEmail();
        this.disabled = user.getDisabled();
    	
    	return this;
    }
    
    /**
     * @return the organizationId
     */
    public Long getOrganizationId() {
        return organizationId;
    }

    /**
     * @return the organizationCode
     */
    public String getOrganizationCode() {
        return organizationCode;
    }

    /**
     * @return the userId
     */
    public Long getUserId() {
        return userId;
    }

    /**
     * @return the userLoginName
     */
    public String getUserLoginName() {
        return userLoginName;
    }

    /**
     * @return the username
     */
    public String getUsername() {
        return username;
    }

    /**
     * @return the departmentId
     */
    public Long getDepartmentId() {
        return departmentId;
    }

    /**
     * @return the phone
     */
    public String getPhone() {
        return phone;
    }

    /**
     * @return the mobile
     */
    public String getMobile() {
        return mobile;
    }

    /**
     * @return the email
     */
    public String getEmail() {
        return email;
    }

    /**
     * @return the disabled
     */
    public boolean isDisabled() {
        return disabled;
    }

    /**
     * @param organizationId the organizationId to set
     */
    public void setOrganizationId(Long organizationId) {
        this.organizationId = organizationId;
    }

    /**
     * @param organizationCode the organizationCode to set
     */
    public void setOrganizationCode(String organizationCode) {
        this.organizationCode = organizationCode;
    }

    /**
     * @param userId the userId to set
     */
    public void setUserId(Long userId) {
        this.userId = userId;
    }

    /**
     * @param userLoginName the userLoginName to set
     */
    public void setUserLoginName(String userLoginName) {
        this.userLoginName = userLoginName;
    }

    /**
     * @param username the username to set
     */
    public void setUsername(String username) {
        this.username = username;
    }

    /**
     * @param departmentId the departmentId to set
     */
    public void setDepartmentId(Long departmentId) {
        this.departmentId = departmentId;
    }

    /**
     * @param phone the phone to set
     */
    public void setPhone(String phone) {
        this.phone = phone;
    }

    /**
     * @param mobile the mobile to set
     */
    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    /**
     * @param email the email to set
     */
    public void setEmail(String email) {
        this.email = email;
    }

    /**
     * @param disabled the disabled to set
     */
    public void setDisabled(boolean disabled) {
        this.disabled = disabled;
    }
    
}